/**
 * This file is part of the CAKIS project.
 * 
 * Copyright (c) 2009-2010 - Florian Arndt, Christian Kerl
 * 
 * @license GNU Lesser General Public License v3 <http://www.opensource.org/licenses/lgpl-3.0.html>
 * @since   15.05.2010
 * @version SVN: $Id: RecipePageRedirectEvent.java 144 2010-05-15 12:02:22Z christian-kerl@web.de $
 */
package org.cakis.server.service.session;

import org.jboss.seam.faces.Redirect;

/**
 * RecipePageRedirectEvent
 *
 * @author Christian Kerl
 */
public class RecipePageRedirectEvent extends PageRedirectEvent {
    private static final long serialVersionUID = 1L;

    private static final String ViewId = "/view/recipe.xhtml";
    private static final String RecipeIdParam = "recipeId";

    private Long id;

    public RecipePageRedirectEvent(ClientSessionInfo session, Long id, String description) {
        super(session, ViewId, description);
        this.id = id;
    }

    @Override
    public void apply(Redirect redirect) {
        super.apply(redirect);
        redirect.setParameter(RecipeIdParam, id);
    }
}
